package com.wang.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wang.domain.TonguePicItem;
import com.wang.mapper.TonguePicItemMapper;
import com.wang.service.TonguePicItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author WangZai
 * @since 2023-04-27
 */
@Service
public class TonguePicItemServiceImpl extends ServiceImpl<TonguePicItemMapper, TonguePicItem> implements TonguePicItemService {

    @Override
    public boolean saveTonguePicItem(TonguePicItem tonguePicItem) {
        return this.save(tonguePicItem);
    }

    @Override
    public boolean saveTonguePicItemList(List<TonguePicItem> tonguePicItemList) {
        return this.saveBatch(tonguePicItemList);
    }

    @Override
    public boolean deleteTonguePicItem(Integer tonguePicItemId) {
        return this.removeById(tonguePicItemId);
    }

    @Override
    public TonguePicItem getTonguePicItemByUUID(String uuid) {
        QueryWrapper<TonguePicItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("u_u_i_d", uuid);
        return this.getOne(queryWrapper);
    }

    @Override
    public TonguePicItem getTonguePicItemById(Integer tonguePicItemId) {
        return this.getById(tonguePicItemId);
    }
}
